package com.sngamelib.topdownshooter;

import java.util.ArrayList;
import java.util.List;

public class BuffEffectManager
{
	///////////////////////////////////////////////////////////////
	//Member Variables
	///////////////////////////////////////////////////////////////
	
	public ArrayList<BuffEffect> fxList;
	
	///////////////////////////////////////////////////////////////
	//Constructors
	///////////////////////////////////////////////////////////////
	
	BuffEffectManager()
	{
		fxList = new ArrayList<BuffEffect>();
	}
	
	BuffEffectManager(int _is)
	{
		fxList = new ArrayList<BuffEffect>();
		fxList.ensureCapacity(_is);
	}
	
	BuffEffectManager(ArrayList<BuffEffect> _fxl)
	{
		int i = 0;
		while(i < _fxl.size())
		{
			fxList.add(_fxl.get(i));
		}
	}
	
	BuffEffectManager(BuffEffectManager _bem)
	{
		int i = 0;
		while(i < _bem.getGroupSize())
		{
			fxList.add(_bem.getEffectAt(i));
			i++;
		}
	}
	
	///////////////////////////////////////////////////////////////
	//Accessor Methods
	///////////////////////////////////////////////////////////////
	
	public BuffEffect getEffect(BuffEffect _be)
	{
		return fxList.get(fxList.indexOf(_be));
	}
	
	public BuffEffect getEffectAt(int _i)
	{
		return fxList.get(_i);
	}
	
	public int getGroupSize()
	{
		return fxList.size();
	}
	
	//wanna try to inform the caller of the success of the record add by returning a boolean... might not be best way with if statement
	public boolean addEffect(BuffEffect _be)
	{
		if(fxList.add(_be))
			return true;
		else
			return false;
	}
	
	public boolean remEffectAt(int _i)
	{
		if(fxList.remove(_i) != null)
			return true;
		else 
			return false;
	}
	
	public boolean remEffect(BuffEffect _be)
	{
		if(fxList.remove(_be))
			return true;
		else
			return false;
	}
}
